<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head profile="http://www.w3.org/2006/03/hcard http://dublincore.org/documents/2008/08/04/dc-html/">
  <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />

  <title>ACL YANG model</title>

  <style type="text/css" title="Xml2Rfc (sans serif)">
  /*<![CDATA[*/
	  a {
	  text-decoration: none;
	  }
      /* info code from SantaKlauss at http://www.madaboutstyle.com/tooltip2.html */
      a.info {
          /* This is the key. */
          position: relative;
          z-index: 24;
          text-decoration: none;
      }
      a.info:hover {
          z-index: 25;
          color: #FFF; background-color: #900;
      }
      a.info span { display: none; }
      a.info:hover span.info {
          /* The span will display just on :hover state. */
          display: block;
          position: absolute;
          font-size: smaller;
          top: 2em; left: -5em; width: 15em;
          padding: 2px; border: 1px solid #333;
          color: #900; background-color: #EEE;
          text-align: left;
      }
	  a.smpl {
	  color: black;
	  }
	  a:hover {
	  text-decoration: underline;
	  }
	  a:active {
	  text-decoration: underline;
	  }
	  address {
	  margin-top: 1em;
	  margin-left: 2em;
	  font-style: normal;
	  }
	  body {
	  color: black;
	  font-family: verdana, helvetica, arial, sans-serif;
	  font-size: 10pt;
	  max-width: 55em;
	  
	  }
	  cite {
	  font-style: normal;
	  }
	  dd {
	  margin-right: 2em;
	  }
	  dl {
	  margin-left: 2em;
	  }
	
	  ul.empty {
	  list-style-type: none;
	  }
	  ul.empty li {
	  margin-top: .5em;
	  }
	  dl p {
	  margin-left: 0em;
	  }
	  dt {
	  margin-top: .5em;
	  }
	  h1 {
	  font-size: 14pt;
	  line-height: 21pt;
	  page-break-after: avoid;
	  }
	  h1.np {
	  page-break-before: always;
	  }
	  h1 a {
	  color: #333333;
	  }
	  h2 {
	  font-size: 12pt;
	  line-height: 15pt;
	  page-break-after: avoid;
	  }
	  h3, h4, h5, h6 {
	  font-size: 10pt;
	  page-break-after: avoid;
	  }
	  h2 a, h3 a, h4 a, h5 a, h6 a {
	  color: black;
	  }
	  img {
	  margin-left: 3em;
	  }
	  li {
	  margin-left: 2em;
	  margin-right: 2em;
	  }
	  ol {
	  margin-left: 2em;
	  margin-right: 2em;
	  }
	  ol p {
	  margin-left: 0em;
	  }
	  p {
	  margin-left: 2em;
	  margin-right: 2em;
	  }
	  pre {
	  margin-left: 3em;
	  background-color: lightyellow;
	  padding: .25em;
	  }
	  pre.text2 {
	  border-style: dotted;
	  border-width: 1px;
	  background-color: #f0f0f0;
	  width: 69em;
	  }
	  pre.inline {
	  background-color: white;
	  padding: 0em;
	  }
	  pre.text {
	  border-style: dotted;
	  border-width: 1px;
	  background-color: #f8f8f8;
	  width: 69em;
	  }
	  pre.drawing {
	  border-style: solid;
	  border-width: 1px;
	  background-color: #f8f8f8;
	  padding: 2em;
	  }
	  table {
	  margin-left: 2em;
	  }
	  table.tt {
	  vertical-align: top;
	  }
	  table.full {
	  border-style: outset;
	  border-width: 1px;
	  }
	  table.headers {
	  border-style: outset;
	  border-width: 1px;
	  }
	  table.tt td {
	  vertical-align: top;
	  }
	  table.full td {
	  border-style: inset;
	  border-width: 1px;
	  }
	  table.tt th {
	  vertical-align: top;
	  }
	  table.full th {
	  border-style: inset;
	  border-width: 1px;
	  }
	  table.headers th {
	  border-style: none none inset none;
	  border-width: 1px;
	  }
	  table.left {
	  margin-right: auto;
	  }
	  table.right {
	  margin-left: auto;
	  }
	  table.center {
	  margin-left: auto;
	  margin-right: auto;
	  }
	  caption {
	  caption-side: bottom;
	  font-weight: bold;
	  font-size: 9pt;
	  margin-top: .5em;
	  }
	
	  table.header {
	  border-spacing: 1px;
	  width: 95%;
	  font-size: 10pt;
	  color: white;
	  }
	  td.top {
	  vertical-align: top;
	  }
	  td.topnowrap {
	  vertical-align: top;
	  white-space: nowrap; 
	  }
	  table.header td {
	  background-color: gray;
	  width: 50%;
	  }
	  table.header a {
	  color: white;
	  }
	  td.reference {
	  vertical-align: top;
	  white-space: nowrap;
	  padding-right: 1em;
	  }
	  thead {
	  display:table-header-group;
	  }
	  ul.toc, ul.toc ul {
	  list-style: none;
	  margin-left: 1.5em;
	  margin-right: 0em;
	  padding-left: 0em;
	  }
	  ul.toc li {
	  line-height: 150%;
	  font-weight: bold;
	  font-size: 10pt;
	  margin-left: 0em;
	  margin-right: 0em;
	  }
	  ul.toc li li {
	  line-height: normal;
	  font-weight: normal;
	  font-size: 9pt;
	  margin-left: 0em;
	  margin-right: 0em;
	  }
	  li.excluded {
	  font-size: 0pt;
	  }
	  ul p {
	  margin-left: 0em;
	  }
	
	  .comment {
	  background-color: yellow;
	  }
	  .center {
	  text-align: center;
	  }
	  .error {
	  color: red;
	  font-style: italic;
	  font-weight: bold;
	  }
	  .figure {
	  font-weight: bold;
	  text-align: center;
	  font-size: 9pt;
	  }
	  .filename {
	  color: #333333;
	  font-weight: bold;
	  font-size: 12pt;
	  line-height: 21pt;
	  text-align: center;
	  }
	  .fn {
	  font-weight: bold;
	  }
	  .hidden {
	  display: none;
	  }
	  .left {
	  text-align: left;
	  }
	  .right {
	  text-align: right;
	  }
	  .title {
	  color: #990000;
	  font-size: 18pt;
	  line-height: 18pt;
	  font-weight: bold;
	  text-align: center;
	  margin-top: 36pt;
	  }
	  .vcardline {
	  display: block;
	  }
	  .warning {
	  font-size: 14pt;
	  background-color: yellow;
	  }
	
	
	  @media print {
	  .noprint {
		display: none;
	  }
	
	  a {
		color: black;
		text-decoration: none;
	  }
	
	  table.header {
		width: 90%;
	  }
	
	  td.header {
		width: 50%;
		color: black;
		background-color: white;
		vertical-align: top;
		font-size: 12pt;
	  }
	
	  ul.toc a::after {
		content: leader('.') target-counter(attr(href), page);
	  }
	
	  ul.ind li li a {
		content: target-counter(attr(href), page);
	  }
	
	  .print2col {
		column-count: 2;
		-moz-column-count: 2;
		column-fill: auto;
	  }
	  }
	
	  @page {
	  @top-left {
		   content: "Internet-Draft"; 
	  } 
	  @top-right {
		   content: "December 2010"; 
	  } 
	  @top-center {
		   content: "Abbreviated Title";
	  } 
	  @bottom-left {
		   content: "Doe"; 
	  } 
	  @bottom-center {
		   content: "Expires June 2011"; 
	  } 
	  @bottom-right {
		   content: "[Page " counter(page) "]"; 
	  } 
	  }
	
	  @page:first { 
		@top-left {
		  content: normal;
		}
		@top-right {
		  content: normal;
		}
		@top-center {
		  content: normal;
		}
	  }
  /*]]>*/
  </style>

  <link href="#rfc.toc" rel="Contents"/>
<link href="#rfc.section.1" rel="Chapter" title="1 Introduction"/>
<link href="#rfc.section.1.1" rel="Chapter" title="1.1 Definitions and Acronyms"/>
<link href="#rfc.section.2" rel="Chapter" title="2 Problem Statement"/>
<link href="#rfc.section.3" rel="Chapter" title="3 Design of the ACL Model"/>
<link href="#rfc.section.3.1" rel="Chapter" title="3.1 ACL Modules"/>
<link href="#rfc.section.4" rel="Chapter" title="4 ACL YANG Models"/>
<link href="#rfc.section.4.1" rel="Chapter" title="4.1 IETF-ACL module"/>
<link href="#rfc.section.4.2" rel="Chapter" title="4.2 Packet Header module"/>
<link href="#rfc.section.4.3" rel="Chapter" title="4.3 A company proprietary module example"/>
<link href="#rfc.section.4.4" rel="Chapter" title="4.4 An ACL Example"/>
<link href="#rfc.section.5" rel="Chapter" title="5 Linux nftables"/>
<link href="#rfc.section.6" rel="Chapter" title="6 Security Considerations"/>
<link href="#rfc.section.7" rel="Chapter" title="7 IANA Considerations"/>
<link href="#rfc.section.8" rel="Chapter" title="8 Acknowledgements"/>
<link href="#rfc.section.9" rel="Chapter" title="9 Change log [RFC Editor: Please remove]"/>
<link href="#rfc.references" rel="Chapter" title="10 References"/>
<link href="#rfc.authors" rel="Chapter"/>


  <meta name="generator" content="xml2rfc version 2.4.7 - http://tools.ietf.org/tools/xml2rfc" />
  <link rel="schema.dct" href="http://purl.org/dc/terms/" />

  <meta name="dct.creator" content="Bogdanovic, D., Sreenivasa, K., and D. Blair" />
  <meta name="dct.identifier" content="urn:ietf:id:draft-bogdanovic-netmod-acl-model-00" />
  <meta name="dct.issued" scheme="ISO8601" content="2014-6-16" />
  <meta name="dct.abstract" content="This document describes information and data model of Access Control List (ACL) basic building blocks.  " />
  <meta name="description" content="This document describes information and data model of Access Control List (ACL) basic building blocks.  " />

</head>

<body>

  <table class="header">
    <tbody>
    
    	<tr>
  <td class="left">NETMOD WG</td>
  <td class="right">D. Bogdanovic</td>
</tr>
<tr>
  <td class="left">Internet-Draft</td>
  <td class="right">Juniper Networks</td>
</tr>
<tr>
  <td class="left">Intended status: Informational</td>
  <td class="right">K. Sreenivasa</td>
</tr>
<tr>
  <td class="left">Expires: December 18, 2014</td>
  <td class="right">Brocade Communications System</td>
</tr>
<tr>
  <td class="left"></td>
  <td class="right">D. Blair</td>
</tr>
<tr>
  <td class="left"></td>
  <td class="right">Cisco Systems</td>
</tr>
<tr>
  <td class="left"></td>
  <td class="right">June 16, 2014</td>
</tr>

    	
    </tbody>
  </table>

  <p class="title">ACL YANG model<br />
  <span class="filename">draft-bogdanovic-netmod-acl-model-00</span></p>
  
  <h1 id="rfc.abstract">
  <a href="#rfc.abstract">Abstract</a>
</h1>
<p>This document describes information and data model of Access Control List (ACL) basic building blocks.  </p>
<h1 id="rfc.status">
  <a href="#rfc.status">Status of This Memo</a>
</h1>
<p>This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.</p>
<p>Internet-Drafts are working documents of the Internet Engineering Task Force (IETF).  Note that other groups may also distribute working documents as Internet-Drafts.  The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.</p>
<p>Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time.  It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."</p>
<p>This Internet-Draft will expire on December 18, 2014.</p>
<h1 id="rfc.copyrightnotice">
  <a href="#rfc.copyrightnotice">Copyright Notice</a>
</h1>
<p>Copyright (c) 2014 IETF Trust and the persons identified as the document authors.  All rights reserved.</p>
<p>This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document.  Please review these documents carefully, as they describe your rights and restrictions with respect to this document.  Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.</p>

  
  <hr class="noprint" />
  <h1 class="np" id="rfc.toc"><a href="#rfc.toc">Table of Contents</a></h1>
  <ul class="toc">

  	<li>1.   <a href="#rfc.section.1">Introduction</a></li>
<li>1.1.   <a href="#rfc.section.1.1">Definitions and Acronyms</a></li>
<li>2.   <a href="#rfc.section.2">Problem Statement</a></li>
<li>3.   <a href="#rfc.section.3">Design of the ACL Model</a></li>
<li>3.1.   <a href="#rfc.section.3.1">ACL Modules</a></li>
<li>4.   <a href="#rfc.section.4">ACL YANG Models</a></li>
<li>4.1.   <a href="#rfc.section.4.1">IETF-ACL module</a></li>
<li>4.2.   <a href="#rfc.section.4.2">Packet Header module</a></li>
<li>4.3.   <a href="#rfc.section.4.3">A company proprietary module example</a></li>
<li>4.4.   <a href="#rfc.section.4.4">An ACL Example</a></li>
<li>5.   <a href="#rfc.section.5">Linux nftables</a></li>
<li>6.   <a href="#rfc.section.6">Security Considerations</a></li>
<li>7.   <a href="#rfc.section.7">IANA Considerations</a></li>
<li>8.   <a href="#rfc.section.8">Acknowledgements</a></li>
<li>9.   <a href="#rfc.section.9">Change log [RFC Editor: Please remove]</a></li>
<li>10.   <a href="#rfc.references">References</a></li>
<li><a href="#rfc.authors">Authors' Addresses</a></li>


  </ul>

  <h1 id="rfc.section.1"><a href="#rfc.section.1">1.</a> <a href="#intro" id="intro">Introduction</a></h1>
<p id="rfc.section.1.p.1">Access Control List (ACL) are one of the basic elements to configure device forwarding behavior.  It is used in many networking concepts such as Policy Based Routing, Firewalls etc.</p>
<p id="rfc.section.1.p.2">An ACL is an ordered set of rules that is used to filter traffic on a networking device.  Each rule is represented by an Access Control Entry (ACE).</p>
<p id="rfc.section.1.p.3">Each ACE has a group of match criteria and a group of action criteria.</p>
<p id="rfc.section.1.p.4">The match criteria consist of tuple of match criteria and metadata matching.</p>
<p/>

<ul>
  <li>Packet header matches apply to fields visible in the packet such as address or class of service or port numbers.</li>
  <li>Metadata matching applies to fields associated with the packet but not in the packet header such as input interface or overall packet length</li>
</ul>
<p id="rfc.section.1.p.6">The actions specify what to do with the packet when the matching criteria is met. These can be any sort of thing from counting to policing or simply forwarding.The list of potential actions is endless depending on the innovations of the networked devices.</p>
<h1 id="rfc.section.1.1"><a href="#rfc.section.1.1">1.1.</a> Definitions and Acronyms</h1>
<p id="rfc.section.1.1.p.1">ACE: Access Control Entry</p>
<p id="rfc.section.1.1.p.2">ACL: Access Control List</p>
<p id="rfc.section.1.1.p.3">AFI: Address Field Identifier</p>
<p id="rfc.section.1.1.p.4">ARP: Address Resolution Protocol</p>
<p id="rfc.section.1.1.p.5">CoS: Class of Service</p>
<p id="rfc.section.1.1.p.6">DSCP: Differentiated Services Code Point</p>
<p id="rfc.section.1.1.p.7">ICMP: Internet Control Message Protocol</p>
<p id="rfc.section.1.1.p.8">IGMP: Internet Group Management Protocol</p>
<p id="rfc.section.1.1.p.9">IP: Internet Protocol</p>
<p id="rfc.section.1.1.p.10">IPv4: Internet Protocol version 4</p>
<p id="rfc.section.1.1.p.11">IPv6: Internet Protocol version 6</p>
<p id="rfc.section.1.1.p.12">MAC: Media Access Control</p>
<p id="rfc.section.1.1.p.13">QoS: Quality of Service</p>
<p id="rfc.section.1.1.p.14">TCP: Transmission Control Protocol</p>
<p id="rfc.section.1.1.p.15">ToS: Type of Service</p>
<p id="rfc.section.1.1.p.16">TTL: Time To Live</p>
<p id="rfc.section.1.1.p.17">UDP: User Datagram Protocol</p>
<p id="rfc.section.1.1.p.18">VLAN: Virtual Local Area Network</p>
<p id="rfc.section.1.1.p.19">VRF: Virtual Routing and Forwarding</p>
<h1 id="rfc.section.2"><a href="#rfc.section.2">2.</a> <a href="#problem" id="problem">Problem Statement</a></h1>
<p id="rfc.section.2.p.1">This document defines a YANG <a href="#RFC6020">[RFC6020]</a> data model for the configuration of ACLs. It is very important that model can be easily reused between vendors and between applications.</p>
<p id="rfc.section.2.p.2">ACL implementations in every device may vary greatly in terms of the filter constructs and Actions that they support. Therefore this draft proposes a simple model that augmented by vendor proprietary models. </p>
<h1 id="rfc.section.3"><a href="#rfc.section.3">3.</a> <a href="#design" id="design">Design of the ACL Model</a></h1>
<p id="rfc.section.3.p.1">Although different vendors have different ACL data models, there is a common understanding of what an access list is. An access list contains an ordered list of rules called access list entries &#8211; ACEs. Actions on the first matching ACE are applied with no processing of subsequent ACEs. Each ACE has a group of match criteria and a group of action criteria. The match criteria consist of packet header matching and metadata matching. Packet header matches apply to fields visible in the packet such as address or class of service or port numbers.  Metadata matching applies to fields associated with the packet, but not in the packet header such as input interface, packet length, or source or destination prefix length. The actions can be any sort of thing from logging to rate limiting or dropping to simply forwarding. There is a default ACE which applies if a packet does not match any of the other ACEs. As some devices fail closed (reject), some fail open (accept) with no explicit configuration, this model defines daufault action, ACE which applies if a packet does not match any of the other ACEs. This will help with cross platform conformitiy and for that reason this draft specifies deny as default action. There is overall operational state for the ACL and operational state for each ACE, and depending on the action, operational state for each action. Access-lists can also have notifications such as logging, configuration changing, activation state changes. The ACL can be applied to targets within the device which may be interfaces of a networked device, applications or features running in the device, or other objects. When applied to interfaces of the networked device, the ACL is applied in a direction which indicates if it should be applied to packet entering (input) or leaving the device (output).</p>
<p id="rfc.section.3.p.2">This draft tries to address the commonalities between all vendors and create a common model, which can be augmented with proprietary models. The base model is very simple and with this design we hope to achieve needed flexibility for each vendor to extend the base model.</p>
<h1 id="rfc.section.3.1"><a href="#rfc.section.3.1">3.1.</a> <a href="#aclmodules" id="aclmodules">ACL Modules</a></h1>
<p id="rfc.section.3.1.p.1">There are three YANG modules in the model. The first module, "ietf-acl", defines generic ACL aspects which are common to all ACLs regardless of their type or vendor. In effect, the module can be viewed as providing a generic ACL "superclass". It imports module "packet-headers" into the match container. The packet headers can be extended with different types and fragments.The packet headers modules can easily be extended to reuse definitions from other modules such as IPFIX <a href="#RFC5101">[RFC5101]</a> or migrate proprietary augmented module definitions into the standard module.</p>
<pre>
module: ietf-acl
   +--rw access-list
      +--rw acl-name?              string
      +--rw acl-oper-data
      |  +--rw match-counter?    ietf:counter64
      |  +--rw permit-counter?   ietf:counter64
      |  +--rw deny-counter?     ietf:counter64
      |  +--rw targets*          string
      +--rw access-list-entries* [rule-name]
      |  +--rw rule-name        string
      |  +--rw matches
      |  |  +--rw (ace-type)?
      |  |  |  +--:(ace-ip)
      |  |  |  |  +--rw source-port-range
      |  |  |  |  |  +--rw lower-port    inet:port-number
      |  |  |  |  |  +--rw upper-port?   inet:port-number
      |  |  |  |  +--rw destination-port-range
      |  |  |  |  |  +--rw lower-port    inet:port-number
      |  |  |  |  |  +--rw upper-port?   inet:port-number
      |  |  |  |  +--rw dscp?                           inet:dscp
      |  |  |  |  +--rw ip-protocol?                    uint8
      |  |  |  |  +--rw (ace-ip-version)?
      |  |  |  |     +--:(ace-ipv4)
      |  |  |  |     |  +--rw destination-ipv4-address?       inet:ipv4-prefix
      |  |  |  |     |  +--rw source-ipv4-address?            inet:ipv4-prefix
      |  |  |  |     +--:(ace-ipv6)
      |  |  |  |        +--rw destination-ipv6-address?       inet:ipv6-prefix
      |  |  |  |        +--rw source-ipv6-address?            inet:ipv6-address
      |  |  |  |        +--rw flow-label?                     inet:ipv6-flow-label
      |  |  |  +--:(ace-eth)
      |  |  |     +--rw destination-mac-address?        yang:mac-address
      |  |  |     +--rw destination-mac-address-mask?   yang:mac-address
      |  |  |     +--rw source-mac-address?             yang:mac-address
      |  |  |     +--rw source-mac-address-mask?        yang:mac-address
      |  |  +--rw input-interface?                string
      |  |  +--rw absolute
      |  |     +--rw start?    yang:date-and-time
      |  |     +--rw end?      yang:date-and-time
      |  |     +--rw active?   boolean
      |  +--rw actions
      |  |  +--rw (packet-handling)?
      |  |     +--:(deny)
      |  |     |  +--rw deny?     empty
      |  |     +--:(permit)
      |  |        +--rw permit?   empty
      |  +--rw ace-oper-data
      |     +--rw match-counter?   ietf:counter64
      +--rw default-actions
         +--rw deny?   empty
        </pre>
<p id="rfc.section.3.1.p.2">Two other module "newco-acl" is example of company proprietary model, that augments the ietf-acl module with definitions that are specific to match criteria and company proprietary extensions to match and action criteria. The model below is shown just an example and it is expected from vendors to create their own propietary models, based on the example below.  </p>
<pre>
module: newco-acl
augment /ietf-acl:access-list/ietf-acl:access-list-entries/ietf-acl:matches:
   +--rw (protocol_payload_choice)?
      +--:(protocol_payload)
         +--rw protocol_payload* [value_keyword]
            +--rw value_keyword    enumeration
augment /ietf-acl:access-list/ietf-acl:access-list-entries/ietf-acl:actions:
   +--rw (action)?
      +--:(count)
      |  +--rw count?                   string
      +--:(policer)
      |  +--rw policer?                 string
      +--:(hiearchical-policer)
         +--rw hierarchitacl-policer?   string
        </pre>
<h1 id="rfc.section.4"><a href="#rfc.section.4">4.</a> <a href="#yangmodel" id="yangmodel">ACL YANG Models</a></h1>
<h1 id="rfc.section.4.1"><a href="#rfc.section.4.1">4.1.</a> <a href="#ietfacl" id="ietfacl">IETF-ACL module</a></h1>
<p id="rfc.section.4.1.p.1">"ietf-acl" is the standard top level module for Access lists. It has a container for "access-list" to store access list information.  This container has information identifying the access list by a name("acl-name") and a list("access-list-entries") of rules associated with the "acl-name".  Each of the entries in the list("access-list-entries") indexed by the string "rule-name" have containers defining "matches" and "actions".  The "matches" define criteria used to identify patterns in "packet-fields".  The "actions" define behavior to undertake once a "match" has been identified.</p>
<pre>
module ietf-acl {
    yang-version 1;

    namespace "urn:ietf:params:xml:ns:yang:ietf-acl";

    prefix ietf-acl;
    
    import ietf-yang-types {
        prefix "ietf";
    }

    import packet-fields {
        prefix "packet-fields";
    }

    revision 2014-05-20{
        description "creating base model for netmod";
    }

    typedef acl-ref {
        description "This type is used by data models that need to referenced an acl";
        type leafref {
            path "/ietf-acl:access-list/ietf-acl:acl-name";
        }
    }

    container access-list {
        description "
                     An access list (acl) is an ordered list of access list     
                     entries (ace). Each ace has a sequence number to define    
                     the order, list of match criteria, and a list of actions.  
                     Since there are several kinds of acls implementeded        
                     with different attributes for each and different for       
                     each vendor, this model accomodates customizing acls       
                     for each kind and for each vendor.                         
                     ";
        leaf acl-name {
            description "name of access-list";
            type string;
        }

        container acl-oper-data {
            description "Overall ACL operational data";
            leaf match-counter {
                description "Total match count for ACL";
                type ietf:counter64;
            }
            leaf permit-counter {
                description "Total permit count for ACL";
                type ietf:counter64;
            }
            leaf deny-counter {
                description "Total deny count";
                type ietf:counter64;
            }
            leaf-list targets {
                description "List of targets where ACL is applied";
                type string;
            }
        }

        list access-list-entries {
            key rule-name;
            ordered-by user;
            leaf rule-name {
                description "Entry name";
                type string;
            }

            container matches {
                description "Define match criteria";
                choice ace-type {
                    case ace-ip {
                        uses packet-fields:acl-ip-header-fields;
                        choice ace-ip-version {
                            case ace-ipv4 {
                                uses packet-fields:acl-ipv4-header-fields;
                            }
                            case ace-ipv6 {
                                uses packet-fields:acl-ipv6-header-fields;
                            }
                        }
                    }
                    case ace-eth {
                        uses packet-fields:acl-eth-header-fields;
                    }
                }
                uses packet-fields:metadata;
            }

            container actions {
                description "Define action criteria";
                choice packet-handling {
                    default deny;
                    case deny {
                        leaf deny {
                            type empty;
                        }
                    }
                    case permit {
                        leaf permit {
                            type empty;
                        }
                    }
                }      
            }

            container ace-oper-data {
                description "Per ace operational data";
                leaf match-counter {
                    description "Number of matches for an ace";
                    type ietf:counter64;
                }
            }
        }

        container default-actions {
            description "Actions that occur if no access-list entry is matched.";
            leaf deny {
                type empty;
            }
        }
    }
}

        </pre>
<h1 id="rfc.section.4.2"><a href="#rfc.section.4.2">4.2.</a> <a href="#pktheaders" id="pktheaders">Packet Header module</a></h1>
<p id="rfc.section.4.2.p.1">The packet fields module defines the necessary groups for matching on fields in the packet including ethernet, ipv4, ipv6, transport layer fields and metadata.  These groupings can be augmented to include other proprietary matching criteria.  Since the number of match criteria is very large, the base draft does not include these directly but references them by "uses" to keep the base module simple.</p>
<pre>
module packet-fields {
    yang-version 1;

    namespace "urn:ietf:params:xml:ns:yang:packet-fields";

    prefix packet-fields;

    import ietf-inet-types {
        prefix "inet";
    }
                    
    import ietf-yang-types {
        prefix "yang";
    }

    revision 2014-06-25 {
        description "Initial version of packet fields used by access-lists";
    }

    grouping acl-transport-header-fields {
        description "Transport header fields";

        container source-port-range {
             description "inclusive range of source ports";
             leaf lower-port {
                 mandatory true;
                 type inet:port-number;
             }
             leaf upper-port {
                 type inet:port-number;
             }
        }       

        container destination-port-range {
             description "inclusive range of destination ports";
             leaf lower-port {
                 mandatory true;
                 type inet:port-number;
             }
             leaf upper-port {
                 type inet:port-number;
             }
        }       
    }

    grouping acl-ip-header-fields {
        description "Header fields common to ipv4 and ipv6";

        uses acl-transport-header-fields;

        leaf dscp {
            type inet:dscp;
        }

        leaf ip-protocol {
            type uint8;
        }

    }

    grouping acl-ipv4-header-fields {
        description "fields in IPv4 header";

        leaf destination-ipv4-address {
            type inet:ipv4-prefix;
        }

        leaf source-ipv4-address {
            type inet:ipv4-prefix;
        }

    }

    grouping acl-ipv6-header-fields {
        description "fields in IPv6 header";

        leaf destination-ipv6-address {
            type inet:ipv6-prefix;
        }

        leaf source-ipv6-address {
            type inet:ipv6-address;
        }

        leaf flow-label {
            type inet:ipv6-flow-label;
        }

    }

    grouping acl-eth-header-fields {
        description "fields in ethernet header";

        leaf destination-mac-address {
            type yang:mac-address;
        }

        leaf destination-mac-address-mask {
            type yang:mac-address;
        }

        leaf source-mac-address {
            type yang:mac-address;
        }

        leaf source-mac-address-mask {
            type yang:mac-address;
        }
    }

    grouping timerange {
        description "Define time range entries to restrict 
            the access. The time range is identified by a name 
            and then referenced by a function, so that those 
            time restrictions are imposed on the function itself.";
        
        container absolute {
            description 
                "Absolute time and date that 
                the associated function starts
                going into effect.";
                
            leaf start {
                type yang:date-and-time; 
                description 
                "Start time and date";
            }
            leaf end {
                type yang:date-and-time; 
                description "Absolute end time and date";
            }
            leaf active {
                type boolean;
                default "true";
                description
                    "Specify the associated function
                    active or inactive state when
                    starts going into effect";
            }
        } // container absolute    
    } //grouping timerange

    grouping metadata {
        description "Fields associated with a packet but not in the header";

        leaf input-interface {
             description "Packet was received on this interface";
             type string;
        }
        uses timerange;
    }
}
          </pre>
<h1 id="rfc.section.4.3"><a href="#rfc.section.4.3">4.3.</a> <a href="#newcoacl" id="newcoacl">A company proprietary module example</a></h1>
<p id="rfc.section.4.3.p.1">In the figure below is an example how proprietary models can be created on top of base ACL module. It is a simple example of how to use 'augment' with an XPath expression which extends instances of a particular type. In this example, all /ietf-acl:access-list/ietf-acl:access-list-entries/ietf-acl:matches are augmented with a new choice, protocol-payload-choice. The protocol-payload-choice uses a grouping with an enumeration of all supported protocol values. In other example, /ietf-acl:access-list/ietf-acl:access-list-entries/ietf-acl:actions are augmented with new choice of actions. Here is an inclusive list of cases listed within a choice statement.</p>
<pre>
module newco-acl {
    yang-version 1;

    namespace "urn:newco:params:xml:ns:yang:newco-acl";

    prefix newco-acl;

    import ietf-acl {
      prefix "ietf-acl";
    }

    revision 2014-05-21{
      description "creating newo proprietary extensions to ietf-acl model";
    }

    augment "/ietf-acl:access-list/ietf-acl:access-list-entries/ietf-acl:matches" {
      description "Newco proprietry simple filter matches";
         choice protocol-payload-choice {
           list protocol-payload {
             key value-keyword;
             ordered-by user;
             description "Match protocol payload";
             uses match-simple-payload-protocol-value;
           }
      }   
    }

    augment "/ietf-acl:access-list/ietf-acl:access-list-entries/ietf-acl:actions" {
      description "Newco proprietary simple filter actions";
      choice action {
         case count {
            description "Count the packet in the named counter";
               leaf count {
                  type string;
               }
            }
         case policer {
           description "Name of policer to use to rate-limit traffic";
            leaf policer {
               type string;
            }
         }
         case hiearchical-policer {
           description "Name of hierarchical policer to use to rate-limit traffic";
           leaf hierarchitacl-policer{
              type string;
           }
         }
      }
    }

  grouping match-simple-payload-protocol-value {
     leaf value-keyword {
       description "(null)";
       type enumeration {
         enum icmp {
           description "Internet Control Message Protocol";
         }
         enum icmp6 {
           description "Internet Control Message Protocol Version 6";
         }
         enum range {
           description "Range of values";
         }
       }
     }
   }
}
          </pre>
<p id="rfc.section.4.3.p.2">Dratf authors expect that different vendors will provide their own yang models as in the example above, which is the extension of the base model</p>
<h1 id="rfc.section.4.4"><a href="#rfc.section.4.4">4.4.</a> <a href="#example" id="example">An ACL Example</a></h1>
<p id="rfc.section.4.4.p.1">Requirement: Deny All traffic from 1.1.1.1 bound for host 2.2.2.2 from leaving.</p>
<p id="rfc.section.4.4.p.2">In order to achieve the requirement, an name access control list is needed. The acl and aces can be described in CLI as the following:</p>
<div id="rfc.figure.1"/>
<div id="An_ACL_Example"/>
<pre>
	    access-list ip iacl
	    deny tcp 1.1.1.1 host 2.2.2.2
	  </pre>
<p class="figure">Figure 1</p>
<p id="rfc.section.4.4.p.3">Here is the example acl configuration xml:</p>
<div id="rfc.figure.2"/>
<div id="An_ACL_XML_example"/>
<pre>
	       &lt;rpc message-id="101" xmlns:nc="urn:cisco:params:xml:ns:yang:ietf-acl:1.0"&gt; 
		 // replace with IANA namespace when assigned
	       &lt;edit-config&gt;
		 &lt;target&gt;
		   &lt;running/&gt;
		 &lt;/target&gt;
		 &lt;config&gt;
		   &lt;top xmlns="http://example.com/schema/1.2/config"&gt;
		     &lt;access-list&gt;
		       &lt;acl-name&gt;sample-ip-acl&lt;/acl-name&gt;
		       &lt;access-list-entries&gt;
			 &lt;rule-name&gt;telnet-block-rule&lt;/rule-name&gt;
			 &lt;matches&gt;
			   &lt;destination-ipv4-address&gt;2.2.2.2&lt;/destination-ipv4-address&gt;
			   &lt;source-ipv4-address&gt;1.1.1.1&lt;/source-ipv4-address&gt;
			 &lt;/matches&gt;
			 &lt;actions&gt;
			   &lt;deny/&gt;
			 &lt;actions/&gt;
		       &lt;/access-list-entries&gt;
		     &lt;/access-list&gt;
		   &lt;/top&gt;
		 &lt;/config&gt;
	       &lt;/edit-config&gt;
	     &lt;/rpc&gt;
	   </pre>
<p class="figure">Figure 2</p>
<h1 id="rfc.section.5"><a href="#rfc.section.5">5.</a> <a href="#nftables" id="nftables">Linux nftables</a></h1>
<p id="rfc.section.5.p.1">As Linux platform is becoming more popular as networking platform, the Linux data model is changing. Previously ACLs in Linux were highly protocol specific and different utilities were used for it (iptables, ip6tables, arptables, ebtables). Recently, this has changed and a single utility, nftables, has been provided. This utility follows very similarly the same base model as proposed in this draft. The nftables support input and output ACEs and each ACE can be defined with match and action.</p>
<h1 id="rfc.section.6"><a href="#rfc.section.6">6.</a> <a href="#security" id="security">Security Considerations</a></h1>
<p id="rfc.section.6.p.1">The YANG module defined in this memo is designed to be accessed via the NETCONF protocol [RFC6241] <a href="#RFC6241">[RFC6241]</a>.  The lowest NETCONF layer is the secure transport layer and the mandatory-to-implement secure transport is SSH [RFC6242] <a href="#RFC6242">[RFC6242]</a>.  The NETCONF access control model [RFC6536] <a href="#RFC6536">[RFC6536]</a> provides the means to restrict access for particular NETCONF users to a pre-configured subset of all available NETCONF protocol operations and content.</p>
<p id="rfc.section.6.p.2">There are a number of data nodes defined in the YANG module which are writable/creatable/deletable (i.e., config true, which is the default).  These data nodes may be considered sensitive or vulnerable in some network environments.  Write operations (e.g.,  &lt;edit-config&gt;) to these data nodes without proper protection can have a negative effect on network operations.</p>
<p id="rfc.section.6.p.3">TBD: List specific Subtrees and data nodes and their sensitivity/vulnerability.  </p>
<h1 id="rfc.section.7"><a href="#rfc.section.7">7.</a> <a href="#iana" id="iana">IANA Considerations</a></h1>
<p id="rfc.section.7.p.1">This document registers a URI in the IETF XML registry [RFC3688] <a href="#RFC3688">[RFC3688]</a>.  Following the format in RFC 3688, the following registration is requested to be made:</p>
<p id="rfc.section.7.p.2">URI: urn:ietf:params:xml:ns:yang:ietf-acl</p>
<p id="rfc.section.7.p.3">Registrant Contact: The IESG.</p>
<p id="rfc.section.7.p.4">XML: N/A, the requested URI is an XML namespace.</p>
<p id="rfc.section.7.p.5">This document registers a YANG module in the YANG Module Names registry [RFC6020].</p>
<p id="rfc.section.7.p.6">name:         ietf-acl namespace:    urn:ietf:params:xml:ns:yang:ietf-acl prefix:       ietf-acl reference:    RFC XXXX </p>
<h1 id="rfc.section.8"><a href="#rfc.section.8">8.</a> <a href="#ack" id="ack">Acknowledgements</a></h1>
<p/>
<h1 id="rfc.section.9"><a href="#rfc.section.9">9.</a> <a href="#changes" id="changes">Change log [RFC Editor: Please remove]</a></h1>
<p/>
<h1 id="rfc.references"><a href="#rfc.references">10.</a> References</h1>
<table>
  <tbody>
    <tr>
      <td class="reference">
        <b id="RFC3688">[RFC3688]</b>
      </td>
      <td class="top"><a>Mealling, M.</a>, "<a href="http://tools.ietf.org/html/rfc3688">The IETF XML Registry</a>", BCP 81, RFC 3688, January 2004.</td>
    </tr>
    <tr>
      <td class="reference">
        <b id="RFC5101">[RFC5101]</b>
      </td>
      <td class="top"><a>Claise, B.</a>, "<a href="http://tools.ietf.org/html/rfc5101">Specification of the IP Flow Information Export (IPFIX) Protocol for the Exchange of IP Traffic Flow Information</a>", RFC 5101, January 2008.</td>
    </tr>
    <tr>
      <td class="reference">
        <b id="RFC6020">[RFC6020]</b>
      </td>
      <td class="top"><a>Bjorklund, M.</a>, "<a href="http://tools.ietf.org/html/rfc6020">YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)</a>", RFC 6020, October 2010.</td>
    </tr>
    <tr>
      <td class="reference">
        <b id="RFC6241">[RFC6241]</b>
      </td>
      <td class="top"><a>Enns, R.</a>, <a>Bjorklund, M.</a>, <a>Schoenwaelder, J.</a> and <a>A. Bierman</a>, "<a href="http://tools.ietf.org/html/rfc6241">Network Configuration Protocol (NETCONF)</a>", RFC 6241, June 2011.</td>
    </tr>
    <tr>
      <td class="reference">
        <b id="RFC6242">[RFC6242]</b>
      </td>
      <td class="top"><a>Wasserman, M.</a>, "<a href="http://tools.ietf.org/html/rfc6242">Using the NETCONF Protocol over Secure Shell (SSH)</a>", RFC 6242, June 2011.</td>
    </tr>
    <tr>
      <td class="reference">
        <b id="RFC6536">[RFC6536]</b>
      </td>
      <td class="top"><a>Bierman, A.</a> and <a>M. Bjorklund</a>, "<a href="http://tools.ietf.org/html/rfc6536">Network Configuration Protocol (NETCONF) Access Control Model</a>", RFC 6536, March 2012.</td>
    </tr>
  </tbody>
</table>
<h1 id="rfc.authors">
  <a href="#rfc.authors">Authors' Addresses</a>
</h1>
<div class="avoidbreak">
  <address class="vcard">
	<span class="vcardline">
	  <span class="fn">Dean Bogdanovic</span> 
	  <span class="n hidden">
		<span class="family-name">Bogdanovic</span>
	  </span>
	</span>
	<span class="org vcardline">Juniper Networks</span>
	<span class="adr">
	  
	  <span class="vcardline">
		<span class="locality"></span> 
		<span class="region"></span>
		<span class="code"></span>
	  </span>
	  <span class="country-name vcardline"></span>
	</span>
	<span class="vcardline">EMail: <a href="mailto:deanb@juniper.net">deanb@juniper.net</a></span>

  </address>
</div><div class="avoidbreak">
  <address class="vcard">
	<span class="vcardline">
	  <span class="fn">Kiran Agrahara Sreenivasa</span> 
	  <span class="n hidden">
		<span class="family-name">Sreenivasa</span>
	  </span>
	</span>
	<span class="org vcardline">Brocade Communications System</span>
	<span class="adr">
	  
	  <span class="vcardline">
		<span class="locality"></span> 
		<span class="region"></span>
		<span class="code"></span>
	  </span>
	  <span class="country-name vcardline"></span>
	</span>
	<span class="vcardline">EMail: <a href="mailto:kkoushik@brocade.com">kkoushik@brocade.com</a></span>

  </address>
</div><div class="avoidbreak">
  <address class="vcard">
	<span class="vcardline">
	  <span class="fn">Dana Blair</span> 
	  <span class="n hidden">
		<span class="family-name">Blair</span>
	  </span>
	</span>
	<span class="org vcardline">Cisco Systems</span>
	<span class="adr">
	  
	  <span class="vcardline">
		<span class="locality"></span> 
		<span class="region"></span>
		<span class="code"></span>
	  </span>
	  <span class="country-name vcardline"></span>
	</span>
	<span class="vcardline">EMail: <a href="mailto:dblair@cisco.com">dblair@cisco.com</a></span>

  </address>
</div>

</body>
</html>
